import 'package:dailypayagent/model/merchant.dart';
import 'package:dailypayagent/model/tree.dart';
import 'package:dailypayagent/provider/view_state_list_model.dart';
import 'package:dailypayagent/provider/view_state_refresh_list_model.dart';
import 'package:dailypayagent/service/wan_android_repository.dart';

/// 微信公众号
class MerchantModel extends ViewStateListModel<Tree> {
  @override
  Future<List<Tree>> loadData() async {
    return await WanAndroidRepository.fetchWechatAccounts();
  }
}

/// 微信公众号文章
class WechatArticleListModel extends ViewStateRefreshListModel<Merchant> {
  /// 公众号id
  final int state;

  WechatArticleListModel(this.state);

  @override
  Future<List<Merchant>> loadData({int pageNum}) async {
    return await WanAndroidRepository.fetchMerchants(pageNum, state);
  }
}
